package Day12;

import java.util.HashMap;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            in.next();
            String str = in.nextLine();
            HashMap<Character,Integer> map = new HashMap<>();
            for(int i = 0;i < str.length();i++){
                map.put(str.charAt(i),map.getOrDefault(str.charAt(i),0) +  1);
            }
            if(map.containsKey('s') && map.containsKey('y') && map.containsKey('h')){
                long countS = map.get('s');
                long countH = map.get('h');
                long countY = map.get('y');
                System.out.print(countH * countS * countY);
            }else{
                System.out.print(0);
            }
        }
    }
}
